<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>"/>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="favicon.ico" >
<link rel="Shortcut Icon" href="favicon.ico" />
<!--[if lt IE 9]>
<!--<script type="text/javascript" src="assets/H-ui/lib/html5.js"></script>-->
<!--<script type="text/javascript" src="assets/H-ui/lib/respond.min.js"></script>-->
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.css"/>
<!--[endif]-->
	<script src="assets/js/jquery.min.js"></script>
	<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui/css/H-ui.min.css" />--%>
<%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/css/H-ui.admin.css" />--%>
<%--<link rel="stylesheet" type="text/css" href="assets/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />--%>
<%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/skin/default/skin.css" id="skin" />--%>
<%--<link rel="stylesheet" type="text/css" href="assets/H-ui/static/h-ui.admin/css/style.css" />--%>
	<link rel="stylesheet" type="text/css" href="assets/css/main.css">
<!--[if IE 6]>
<!--<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>-->
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>权限管理</title>
<meta name="keywords" content="">
<meta name="description" content="">

</head>
<body>
<div class="container">
	<div class="col-lg-10 col-lg-offset-1">
		<div class="panel-body"></div>
			<table class="table table-hover table-bordered<%--table table-border table-bordered table-hover table-bg--%>">

				<thead>
					<%--<tr>--%>
						<%--<th scope="col" colspan="6">权限管理</th>--%>
					<%--</tr>--%>
					<tr class="text-c">
						<th width="40" style="text-align: center">ID</th>
						<th width="200" style="text-align: center">角色名</th>
						<th width="70" style="text-align: center">权限分配</th>
					</tr>
				</thead>
				<tbody style="text-align: center">
				<c:if test="${not empty roleList.list}">
				<c:forEach items="${roleList.list}" var="x" >
					<tr class="text-c">
						<td>${x.roleId}</td>
						<td>${x.roleName}</td>
						<td class="f-14"><a title="分配权限" href="javascript:;"
											onclick="edit('权限分配','power/list.action?roleId='+${x.roleId})" style="text-decoration:none" class="btn-primary btn-sm">分配权限</a> </td>
					</tr>
				</c:forEach>
				</c:if>
				</tbody>
			</table>
		<div id="page" style="float: right" align="center">
			当前第${roleList.pageNum}页, 总共${roleList.pages}页，每页${roleList.pageSize}行，总共${roleList.total}行。
			<a id="firstPage" class="btn-sm btn-primary" onclick="changeNum(${roleList.prePage})">上一页</a>
			<a id="lastPage" class="btn-sm btn-primary" onclick="changeNum(${roleList.nextPage})">下一页</a>
		</div>
	</div>
</div>
		<%--</article>--%>
	<%--</div>--%>
<%--</section>--%>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="assets/H-ui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="assets/H-ui/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="assets/H-ui/static/h-ui.admin/js/H-ui.admin.page.js"></script>


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="assets/H-ui/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="assets/H-ui/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
/*管理员-角色-添加*/
function add(title,url,w,h){
    layer_show(title,url,w,h);
}
/*管理员-角色-编辑*/
function edit(title,url,id,w,h){
	layer_show(title,url,w,h);
}
/*管理员-角色-删除*/
function admin_role_del(id){
    layer.confirm('角色删除须谨慎，确认要删除吗？',function(index){
        //此处请求后台程序，下方是成功后的前台处理……

        window.location.href = "del.action?roleId="+id;
        // $(obj).parents("tr").remove();
        layer.msg('已删除!',{icon:1,time:1000});
    });

}
function changeNum(obj) {
    var pageNum=obj;
    window.location.href="power/power.action?pageNum="+pageNum;
}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>